Lesson 7 Exercise: Using Search Criteria

Objective

In this exercise you will learn how to create and use a criteria to find all the requirements for a product part in the example model.

Try to complete the following steps on your own. If you need help, click the step to jump to a set of more detailed steps.

1	Start METIS and Create Exercise Model

Create a new model called MyExerciseL7 based on the Training template.

2	Open Criteria Editor

Open the Criteria Editor and position it for convenient viewing.

3	Create New Criteria File

Create a new criteria file called MyCriteriaL7.

4	Create New Criteria

In the file MyCriteriaL7, create a new criteria called FindRequirements.

5	Define  Drop Context for Criteria

Since you want the search to be run on product parts, which are objects, specify that the drop context of the FindRequirements criteria is limited to objects.

6	Add a Path Node

You want the search to find objects connected to the product part objects that the criteria is dropped on. To define this, add a path node to indicate that you want to search for objects connected to a set of objects.

7	Define Type of Relationship

Since the relationship type that connects product parts to requirement objects is Requirement to, define the relationship type to follow accordingly. The search criteria will then only find objects connected to the product parts using the Requirement to relationship type.

8	Define Object to Find

Since the requirement objects exist at the origin end of the Requirement to relationship, define the object to find as the origin object.

9	Search from the Criteria Editor

Save your changes and perform the search directly from the Criteria Editor; find the requirements for product part C40.

10	Search from the Loaded Tree

Perform the same search from the Loaded tree; this time find the requirements for product parts C40 and D35.

11	Use Predefined Criteria

Use predefined GEM criteria to search for all the requirements in the model view.

12	Save the Criteria File and Close METIS

13	Practice on Your Own (Optional)

Start METIS and Create Exercise Model

Complete the following steps to start METIS and create a new model file based on an example template:

1	Minimize your web browser and any other application you have open (except this window) to see your desktop.

2	Double-click the METIS icon [image] to launch METIS.

3	In the dialog box, click the Model From Template option.

4	In the template list, click Training, then click OK.

5	In the file dialog box, enter MyExerciseL7 for the filename and click Save.

6	Position this Exercise window so that you have a good view of the modeling window.

Open Criteria Editor

Complete the following steps:

1	Click the Tools menu and choose Edit Search Criteria.

2	Position the Criteria Editor window partly over the left pane of the METIS window so that you have a good view of the modeling window.  Note that the Criteria Editor is pushed behind METIS when you drag search criteria from the editor. The Criteria Editor must be placed over the left pane of the METIS window in order to pop it in front when dragging types from the Domain tree.

Create New Criteria File

Create a new file for your criteria as follows:

1	In the Criteria Editor, click the New File button.

2	In the File dialog box, enter MyCriteriaL7 for the filename and click Save.

Create New Criteria

Add a new criteria to your file as follows:

1	In the criteria file list, right-click on the new MyCriteriaL7.kmd file and click New, then Criteria.

2	In the dialog box, enter the criteria name FindRequirements and then click OK.

Define Drop Context for Criteria

Since you want the search to be run on product parts, which are objects, specify that the drop context of the FindRequirements criteria is limited to objects as follows:

1	If necessary, click on the FindRequirements criteria to display the criteria properties to the right.

2	Select drop context Object, then click the green Go button [image].

Add a Path Node

You want the search to find objects connected to the product parts that the criteria is dropped on. To define this, add a path node to indicate that you want to search for objects connected to a set of objects as follows:

1	Right-click on the and node, click New and then Path.

2	Right-click on the from node and click New and then User Collection.

Note: User Collection indicates the search will be run on an object or on a set of selected objects.

Define Type of Relationship

The relationship type that connects product parts to requirement objects is Requirement to. Complete the following steps to define the relationship type to follow. The search criteria will then only find objects connected to the product parts using the Requirement to relationship type.

1	Right-click on the path node and choose New, then TargetOf.

2	Right-click the new targetof node, point to New and choose Relationship Type.

3	Click the Domain tab and expand the Product domain and the Relationship Types domain.

4	Drag the relationship type Requirement to from the Domain tree and drop it on the relshp “My Type” node. Note that the Criteria Editor pops to the front when you drag types from the Domain tree.

Define Object to Find

Since the requirement objects exist at the origin end of the Requirement to relationship, define the object to find as the origin object as follows:

•	Right-click on the path node and choose New, then Origin.

Note: origin indicates that the search will find the origin objects of the followed relationships. It is not necessary to specify the object type in this case, since it will always be Requirement.

Example

Search from the Criteria Editor

Save the edits you’ve made and complete the following steps to perform the search directly from the Criteria Editor. This search finds the requirements for one Product part.

1	Click the Apply button.

2	Drag the criteria FindRequirements from the Criteria tree and drop it on product part C40. The requirements connected to this part should be temporarily selected. Click Select in the pop-up menu to select them permanently.

3	Click the Criteria Editor on your taskbar to pop it to the front, and then click Close to close it.

Example

Search from the Loaded Tree

Complete the following steps to perform a search from the Loaded tree. This search finds the requirements for several product parts.

1	Select the product parts C40 and D35.

2	Click the right pointing arrow at the bottom of the left pane of the METIS window to display the Loaded tab. Click the Loaded tab, find the file MyCriteriaL7.kmd, and then click the + icon to display the criteria.

3	Drag the criteria FindRequirements from the Loaded tree and drop onto one of the selected product parts. All the requirements connected to parts C40 and D35 should now be temporarily selected. Click Select in the pop-up menu to select them permanently.

Note: The search criteria was added to the Loaded tree when you clicked Apply in the Criteria Editor.

Example

Use Predefined Criteria

Use predefined GEM criteria to find all objects of a specific type:

•	In the Requirements container, right-click a requirement object and choose Select From Criteria, then All Requirements from the menu.

Example

Save the Criteria File and Close METIS

Complete the following steps to finish the lesson:

1	From the File menu, click Save All.

2	In the File box, click Save.

3	From the File menu, click Exit.

4	Close this window and maximize your browser to continue with the course.

Practice on Your Own (Optional)


Practice on Your Own (Optional)

•	Practice using the predefined criteria (in the Modeling domain) to find various objects in the model.

•	Create new criteria in the file MyCriteriaL7 to find requirements REQ147 and REQ795 (Search for All Instances of a Given Type with a Specified Name).

•	Use the Find Instances dialog box on the Edit menu to search for objects and relationships with or without particular property values, and independent of their type.

•	Open the METIS help file, expand the Searching a Model section and select Example Search Criteria. Select from the examples provided to create some new search criteria for this model.


 Nodes in Search Criteria

Back to Exercise


 Search Results for Product C40

Back to Exercise


Search Results for Products C40 and D35

Back to Exercise


 All Requirements

Back to Exercise